<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<style>
.bt_view {
	background-color: #8099de;
	border: 1px solid #999;
	width: 80px;
	height: 20px;
	border-radius: 8px;
	border: none;
	margin: 0 0 0 5px;
	font-weight: bold;
	font-size: 0.9em;
	color: #FFF;
	background-image: url(../images/member/dup.jpg);
	background-repeat: repeat-x;
	background-position: center center;
}
.bt_view_small {
	background-color: #8099de;
	border: 1px solid #999;
	width: 40px;
	height: 18px;
	border-radius: 8px;
	border: none;
	margin: 0 0 0 5px;
	font-weight: bold;
	font-size: 0.8em;
	color: #FFF;
	background-image: url(../images/member/dup.jpg);
	background-repeat: repeat-x;
	background-position: center center;
}
</style>
<script>
	function addCertif() {
		document.getElementById("modify").submit();
	}
</script>

<div id="member_page">
	<header>
		<div id="title">
			<b>Modify</b>
		</div>

		<div id="bar"></div>
	</header>

	<section id="member_form">
		<form:form id="modify" action="modifyAction" modelAttribute="member">
			<table id="table-simple" summary="사용자 등록 결과">
				<form:input path="seqId" type="hidden" value="${member.seqId }" />
				<form:input path="memberId" type="hidden" value="${member.memberId }" />
				<form:input path="memberPassword" type="hidden" value="${member.memberPassword }" />
				<form:input path="name" type="hidden" value="${member.name }" />
				<form:input path="gender" type="hidden" value="${member.gender }" />
				<form:input path="dateOfBirth" type="hidden" value="${member.dateOfBirth }" />
				<tr>
					<th width="120">번호</th>
					<td width="460">${member.seqId }</td>
				</tr>
				<tr>
					<th>아이디</th>
					<td>${member.memberId }</td>
				</tr>
				<tr>
					<th>이름</th>
					<td>${member.name }</td>
				</tr>
				<tr>
					<th>성별</th>
					<td>${member.gender }</td>
				</tr>

				<tr>
					<th>생년월일</th>
					<td>${member.dateOfBirth }</td>
				</tr>
				<tr>
					<th>연락처</th>
					<td><form:input path="phoneNumber" type="text"
							value="${member.phoneNumber }" /></td>
				</tr>
				<tr>
					<th>이메일</th>
					<td><form:input path="email" type="text"
							value="${member.email }" /></td>

				</tr>
				<tr>
					<th>대학교</th>
					<td><form:input path="university" type="text"
							value="${member.university }" /></td>
				</tr>
				<tr>
					<th>전공</th>
					<td><form:input path="major" type="text"
							value="${member.major }" /></td>
				</tr>
				<tr>
					<th>졸업연도</th>
					<td><form:input path="graduatedYear" type="text"
							value="${member.graduatedYear }" /></td>
				</tr>
				<tr>
					<th>주소</th>
					<td><form:input path="address" type="text"
							value="${member.address }" /></td>
				</tr>

				<tr>
					<th>우대사항</th>
					<td><form:input path="addPoint" type="text"
							value="${member.addPoint }" /></td>
				</tr>
				<tr>
					<th>언어</th>
					<td><form:input path="language" type="text"
							value="${member.language }" /></td>
				</tr>
				<tr>
					<th>연수과정</th>
					<td>${member.course.courseName }</td>
				</tr>
				<tr>
					<th>자격증</th>
					<td>
						<table>
							<c:forEach items="${member.certificationList }"
								var="certification">
								<tr>
									<td>${certification.certificationName }</td>
									<td><a
										href="<c:url value="/member/removeCerti?seqId=${member.seqId }&certificationId=${certification.certificationId }"/>">
										<button class="bt_view_small">삭제</button>
										</a>
									</td>
								</tr>
							</c:forEach>
						</table>
					</td>
				</tr>
			</table>
		</form:form>
		<p align="center" >
		<form method="post" action="addCerti">
			<input name="seqId" type="hidden" value="${member.seqId }" /> <select
				name="certificationId">
				<c:forEach items="${certifications }" var="certification">
					<option value="${certification.certificationId }">${certification.certificationName
						}</option>
					<br>
				</c:forEach>
			</select> <input type="submit" value="추가" class="bt_view"/>
		</form>

		<p align="center">
			<input type="button" value="수정하기" onClick="addCertif()" class="bt_view" />
	</section>
</div>